<template>
	<view>
		<view class="TUI-message-input-container">
<!-- 			<view class="TUI-commom-function">
				<view v-for="(item, index) in commonFunction" :key="index" class="TUI-commom-function-item" :data-function="item" @tap="handleCommonFunctions">
					{{ item.name }}
				</view>
			</view> -->
			<view class="TUI-message-input">
				<image class="TUI-icon" @tap="switchAudio" :src="isAudio ? '/static/image/audio.png' : '/static/image/record.png'"></image>
				<image class="TUI-icon" @tap="handleExtensions" src="/static/image/more.svg"></image>
				<view v-if="!isAudio" class="TUI-message-input-main">
					
					<input
						class="TUI-message-input-area"
						:adjust-position="false"
						cursor-spacing="20"
						v-model="inputText"
						@input="onInputValueChange"
						maxlength="140"
						type="text"
						placeholder-class="input-placeholder"
						placeholder="说点什么呢~"
						@focus="inputBindFocus"
						@blur="inputBindBlur"
					/>
					
					<image class="TUI-icon" @tap="handleEmoji" src="@/static/image/xiaol.png" mode="widthFix"></image>
				</view>
				<view
					v-else
					class="TUI-message-input-main"
					@longpress="handleLongPress"
					@touchmove="handleTouchMove"
					@touchend="handleTouchEnd"
					style="display: flex; justify-content: center; font-size: 32rpx; font-family: PingFangSC-Regular;"
				>
					<text>{{ text }}</text>
				</view>
				<view class="TUI-message-input-functions" hover-class="none">
					<view  class="TUI-sendMessage-btn btn" @tap="sendTextMessage">发送</view>
				</view>
			</view>
			<view v-if="displayFlag === 'emoji'" class="TUI-Emoji-area"><TUI-Emoji @enterEmoji="appendMessage"></TUI-Emoji></view>
			<view v-if="displayFlag === 'extension'" class="TUI-Extensions">
				<!-- TODO: 这里功能还没实现 -->
				<!--        <camera device-position="back" flash="off" binderror="error" style="width: 100%; height: 300px;"></camera>-->
				<!-- <view class="TUI-Extension-slot" @tap="sendRedBox">
					<image class="TUI-Extension-icon" src="../../../static/assets/redBox.png"></image>
					<view class="TUI-Extension-slot-name">发送红包</view>
				</view> -->
				<view class="TUI-Extension-slot" @tap="handleSendPicture">
					<image class="TUI-Extension-icon" src="/static/image/take-photo.svg"></image>
					<view class="TUI-Extension-slot-name">拍摄照片</view>
				</view>
				<view class="TUI-Extension-slot" @tap="handleSendImage">
					<image class="TUI-Extension-icon" src="/static/image/send-img.svg"></image>
					<view class="TUI-Extension-slot-name">发送图片</view>
				</view>
				<!-- <view class="TUI-Extension-slot" @tap="handleShootVideo">
					<image class="TUI-Extension-icon" src="../../../static/assets/take-video.svg"></image>
					<view class="TUI-Extension-slot-name">拍摄视频</view>
				</view> -->
				<!-- <view class="TUI-Extension-slot" @tap="handleSendVideo">
					<image class="TUI-Extension-icon" src="/static/Tim/send-video.svg"></image>
					<view class="TUI-Extension-slot-name">发送视频</view>
				</view> -->
				<!-- <view class="TUI-Extension-slot" @tap="handleCalling(1)">
					<image class="TUI-Extension-icon" src="../../../static/assets/audio-calling.svg"></image>
					<view class="TUI-Extension-slot-name">语音通话</view>
				</view>
				<view class="TUI-Extension-slot" @tap="handleCalling(2)">
					<image class="TUI-Extension-icon" src="../../../static/assets/video-calling.svg"></image>
					<view class="TUI-Extension-slot-name">视频通话</view>
				</view>
				<view class="TUI-Extension-slot" @tap="handleServiceEvaluation">
					<image class="TUI-Extension-icon" src="../../../static/assets/service-assess.svg"></image>
					<view class="TUI-Extension-slot-name">服务评价</view>
				</view> -->
				<!-- <view class="TUI-Extension-slot" @tap="handleSendCompact" v-if="userInfo.is_kefu>0">
					<image class="TUI-Extension-icon" src="/static/Tim/contract.png"></image>
					<view class="TUI-Extension-slot-name">发送合同</view>
				</view> -->
			</view>
			<TUI-Common-Words class="tui-cards" :display="displayCommonWords" @sendMessage="$handleSendTextMessage" @close="$handleCloseCards"></TUI-Common-Words>
			<TUI-Order-List class="tui-cards" :display="displayOrderList" @sendCustomMessage="$handleSendCustomMessage" @close="$handleCloseCards"></TUI-Order-List>
			<TUI-Service-Evaluation
				class="tui-cards"
				:display="displayServiceEvaluation"
				@sendCustomMessage="$handleSendCustomMessage"
				@close="$handleCloseCards"
			></TUI-Service-Evaluation>
		</view>
		<view class="record-modal" v-if="popupToggle" @longpress="handleLongPress" @touchmove="handleTouchMove" @touchend="handleTouchEnd">
			<view class="wrapper"><view class="modal-loading"></view></view>
			<view class="modal-title">{{ title }}</view>
		</view>
		<!-- <yk-authpup ref="authpup" type="top" @changeAuth="changeAuth" :permissionID="permissionID" :paddingtop="60">
		</yk-authpup> -->
	</view>
</template>

<script>
import TUIEmoji from '../message-elements/emoji/index';
import TUICommonWords from '../message-private/common-words/index';
import TUIOrderList from '../message-private/order-list/index';
import TUIServiceEvaluation from '../message-private/service-evaluation/index';
import tim from '@/common/utils/tim';
export default {
	data() {
		return {
			// todo  conversation
			// conversation: {},
			userInfo:global.userInfo,
			firstSendMessage: true,
			inputText: '',
			extensionArea: false,
			sendMessageBtn: false,
			displayFlag: '',
			isAudio: false,
			bottomVal: 0,
			startPoint: 0,
			popupToggle: false,
			isRecording: false,
			canSend: true,
			text: '按住说话',
			title: ' ',
			notShow: false,
			isShow: true,
			recordTime: 0,
			recordTimer: null,
			ptshow:0,
			permissionID:'WRITE_EXTERNAL_STORAGE',
			commonFunction: [
				{
					name: '常用语',
					key: '0'
				},
				{
					name: '发送订单',
					key: '1'
				},
				{
					name: '服务评价',
					key: '2'
				}
			],
			displayServiceEvaluation: false,
			displayCommonWords: false,
			displayOrderList: false,
			authorization:false
		};
	},

	components: {
		TUIEmoji,
		TUICommonWords,
		TUIOrderList,
		TUIServiceEvaluation,
	},
	props: {
		conversation: {
			type: Object,
			default: () => {}
		}
	},
	watch: {
		conversation: {
			handler: function(newVal) {
				// todo 值会被改变
				// this.setData({
				//   conversation: newVal
				// });
			},
			immediate: true,
			deep: true
		}
	},

	created() {
		// 加载声音录制管理器
		this.recorderManager = uni.getRecorderManager()
		const innerAudioContext = uni.createInnerAudioContext()
		innerAudioContext.autoplay = true;
		// #ifdef APP-PLUS
		var quanxianData = plus.navigator.checkPermission('RECORD');
		// if(quanxianData !== 'authorized'){
		// 	// 先调用一次，提示开启权限
		// 	this.recorderManager.start({format:'PCM'});
		// 	setTimeout(()=>{
		// 		uni.hideLoading();
		// 		this.isShow = false;
		// 		recorderManager.stop();
		// 	},500)
		// }
		// #endif
		this.recorderManager.onStop(res => {
			console.log(res)
			clearInterval(this.recordTimer);
			// 兼容 uniapp 打包app，duration 和 fileSize 需要用户自己补充
			// 文件大小 ＝ (音频码率) x 时间长度(单位:秒) / 8
			let msg = {
				duration: res.duration ? res.duration : this.recordTime * 1000,
				tempFilePath: res.tempFilePath,
				fileSize: res.fileSize ? res.fileSize : ((48 * this.recordTime) / 8) * 1024
			};
			console.log(msg)
			uni.hideLoading();
			// 兼容 uniapp 语音消息没有duration
			if (this.canSend) {
				if (msg.duration < 1000) {
					uni.showToast({
						title: '录音时间太短',
						icon: 'none'
					});
				} else {
					// res.tempFilePath 存储录音文件的临时路径
					const message = tim.createAudioMessage({
						to: this.getToAccount(),
						conversationType: this.conversation.type,
						payload: {
							file: msg
						}
					});
					this.$sendTIMMessage(message);
				}
			}

			// this.setData({
			// 	startPoint: 0,
			// 	popupToggle: false,
			// 	isRecording: false,
			// 	canSend: true,
			// 	title: ' ',
			// 	text: '按住说话'
			// });
		});
		// this.ptStatus()
	},

	methods: {
		ptStatus(){
			this.$api.post(global.apiUrls.ptStatus).then(res => {
				// console.log(res.data)
				this.ptshow=res.data.data.status
			}).catch(err => {
			  
			})
		},
		switchAudio() {
			this.isAudio=!this.isAudio,
			this.text='按住说话'
		},

		sendRedBox(){
			
		},

		handleLongPress(e) {
			console.log('开始录音')
			let that=this
			this.permissionID='SOUND_RECORDER',
			// setTimeout(()=>{
			// 	that.$refs['authpup'].open()
			// },1000)
			this.recorderManager.start({
				duration: 60000,
				// 录音的时长，单位 ms，最大值 600000（10 分钟）
				sampleRate: 44100,
				// 采样率
				numberOfChannels: 1,
				// 录音通道数
				encodeBitRate: 192000,
				// 编码码率
				format: 'aac' // 音频格式，选择此格式创建的音频消息，可以在即时通信 IM 全平台（Android、iOS、微信小程序和Web）互通
			})
			this.startPoint=e.touches[0]
			this.title='正在录音'
			this.notShow=true
			this.isShow=false,
			this.isRecording=true,
			this.popupToggle=true,
			this.recordTime=0
		
			this.recordTimer = setInterval(() => {
				this.recordTime++;
			}, 1000);
		},

		// 录音时的手势上划移动距离对应文案变化
		handleTouchMove(e) {
			if (this.isRecording) {
				if (this.startPoint.clientY - e.touches[e.touches.length - 1].clientY > 100) {
					this.text='抬起停止',
					this.title='松开手指，取消发送'
					this.canSend=false
				} else if (this.startPoint.clientY - e.touches[e.touches.length - 1].clientY > 20) {
					this.text='抬起停止',
					this.title='上划可取消',
					this.canSend=true
				} else {
					this.text='抬起停止',
					this.title='正在录音',
					this.canSend=true
				}
			}
		},

		// 手指离开页面滑动
		handleTouchEnd() {
			this.isRecording=false
			this.popupToggle=false
			// this.setData({
				
				
			// });
			uni.hideLoading();
			this.recorderManager.stop();
			console.log('结束录音')
		},
		handleEmoji() {
			let targetFlag = 'emoji';

			if (this.displayFlag === 'emoji') {
				targetFlag = '';
			}

			this.displayFlag=targetFlag
			console.log('targetFlag',targetFlag)
		},

		handleExtensions() {
			let targetFlag = 'extension';

			if (this.displayFlag === 'extension') {
				targetFlag = '';
			}
			this.displayFlag=targetFlag
		},

		error(e) {
			console.log(e.detail);
		},

		handleSendPicture() {
			let that=this
			// #ifdef APP-PLUS
			setTimeout(()=>{
				this.$refs['authpup'].open();
			},800)
			// #endif
			// #ifdef H5
			this.changeAuth()
			// #endif
			this.permissionID='WRITE_EXTERNAL_STORAGE',
			this.messagetype='camera'
			// this.sendImageMessage('camera');
		},

		handleSendImage() {
			let that=this
			if(this.authorization==false){
				console.log('未授权')
				// #ifdef APP-PLUS
				setTimeout(()=>{
					this.$refs['authpup'].open();
				},800)
				// #endif
				// #ifdef H5
				this.changeAuth()
				// #endif
			}else{
				console.log('已授权')
			}
			
			this.permissionID='WRITE_EXTERNAL_STORAGE',
			this.messagetype='album'
		},
		changeAuth(){
			console.log(this.messagetype)
			this.authorization=true
			this.sendImageMessage(this.messagetype);
		},
		sendImageMessage(type) {
			let that=this
			uni.chooseImage({
				sourceType: [type],
				count: 1,
				success: res => {
					if (res) {
						const message = tim.createImageMessage({
							to: this.getToAccount(),
							conversationType: this.conversation.type,
							payload: {
								file: res
							},
							onProgress: percent => {
								message.percent = percent;
							}
						});
						this.$sendTIMMessage(message);
					}
				}
			});
			// if(type=='camera'){
			// 	uni.chooseVideo({
			// 		mediaType: ['video'], // 视频
			// 		count: 1,
			// 		compressed: false,
			// 		sourceType: ['camera', 'album'], // album 从相册选视频，camera 使用相机拍摄，默认为：['album', 'camera']
			// 		maxDuration: 60, // 设置最长时间60s
			// 		camera: 'back', // 后置摄像头
			// 		success: function (res) {
			// 			if (res){
			// 				console.log(that.conversation.type)
			// 				const message = uni.$TUIKit.createVideoMessage({
			// 					to: that.getToAccount(),
			// 					conversationType: that.conversation.type,
			// 					payload: {
			// 						file: res
			// 					},
			// 					onProgress: percent => {
			// 						message.percent = percent;
			// 					}
			// 				});
			// 				console.log(13)
			// 				that.$sendTIMMessage(message);
			// 			}
			// 		}
			// 	});
			// }else{
			// 	uni.chooseImage({
			// 		sourceType: [type],
			// 		count: 1,
			// 		success: res => {
			// 			if (res) {
			// 				const message = uni.$TUIKit.createImageMessage({
			// 					to: this.getToAccount(),
			// 					conversationType: this.conversation.type,
			// 					payload: {
			// 						file: res
			// 					},
			// 					onProgress: percent => {
			// 						message.percent = percent;
			// 					}
			// 				});
			// 				this.$sendTIMMessage(message);
			// 			}
			// 		}
			// 	});
			// }
			
		},

		// handleShootVideo() {
		// 	this.sendVideoMessage('camera');
		// },

		handleSendVideo() {
			let that=this
			this.permissionID='WRITE_EXTERNAL_STORAGE',
			this.messagetype='camera'
			// #ifdef APP-PLUS
			setTimeout(()=>{
				that.$refs['authpup'].open()
			},1000)
			// #endif
			// #ifdef H5
			this.changeAuth()
			// #endif
			
			// this.sendVideoMessage('album');
		},
		random(min, max) {
		  return Math.floor(Math.random() * (max - min + 1) + min);
		},
		handleSendCompact(){
			console.log(global.userInfo)
			// return
			this.$api.get(global.apiUrls.createTemplate,{
				kf_id:global.userInfo.user_id,
				order_id:this.conversation.conversationID,
			}).then(res => {
				if(res.data.code==999){
					console.log('授权')
					uni.hideToast()
					 // uni.$u.toast(res.data.msg)
					 // let text='请先授权法大大'
					 var params = {
					 	businessID:'recipe_view_auth', //自定义消息列表查询唯一标识
										
					 }	
					const message = uni.$TUIKit.createCustomMessage({
						to:this.getToAccount(),
						conversationType: this.conversation.type,
						payload: {
							data:JSON.stringify(params),
							text:'合同授权'
						},
						needReadReceipt: true
					});
					this.$sendTIMMessage(message);
				}else if(res.data.code==1){
					console.log(res)
					var params = {
						businessID:'recipe_view', //自定义消息列表查询唯一标识
						user_qs_url:res.data.data.user_qs_url,
						to_user_id_url:res.data.data.to_user_id_url,
						user_id:res.data.data.user_id,
						to_user_id:res.data.data.to_user_id,
						signTaskId:res.data.data.signTaskId
					}	
					const message = uni.$TUIKit.createCustomMessage({
						to: this.getToAccount(),
						conversationType: this.conversation.type,
						payload: {
							data:JSON.stringify(params), // 用于标识该消息是骰子类型消息
							// description: String(this.random(1,6)), // 获取骰子点数
							// extension: ''
							title:'合同签署',
							content:'卖家您好,可以签署在线合同了，若没有在法大大实名认证过，则需实名，您可点击下方按开始操作(签署我合同中心签署)买家您好，您选择的包赔证明和交易合同享有相同的权益，可点击下方按钮获取或合同中心查看',
							mold:'卖家签署'
						},
						onProgress: percent => {
							message.percent = percent;
						}
					});
					this.$sendTIMMessage(message);
				}else if(res.data.code==0){
					uni.$u.toast(res.data.msg)
				}
			  // if(res.data.code==1){
				  
			  // }else{
				 
			  // }
			})
			
		},
		sendVideoMessage(type) {
			uni.chooseVideo({
				sourceType: [type],
				// 来源相册或者拍摄
				maxDuration: 60,
				// 设置最长时间60s
				camera: 'back',
				// 后置摄像头
				success: res => {
					if (res) {
						const message = uni.$TUIKit.createVideoMessage({
							to: this.getToAccount(),
							conversationType: this.conversation.type,
							payload: {
								file: res
							},
							onProgress: percent => {
								message.percent = percent;
							}
						});
						this.$sendTIMMessage(message);
					}
				}
			});
		},

		handleCommonFunctions(e) {
			switch (e.target.dataset.function.key) {
				case '0':
					this.displayCommonWords=true
					break;

				case '1':
					this.displayOrderList=true
					break;

				case '2':
					this.displayServiceEvaluation=true
					break;

				default:
					break;
			}
		},

		handleSendOrder() {
			this.displayOrderList=true
		},

		appendMessage(e) {
			this.inputText=this.inputText + e.detail.message,
			this.sendMessageBtn=true
		},

		getToAccount() {
			if (!this.conversation || !this.conversation.conversationID) {
				return '';
			}

			switch (this.conversation.type) {
				case 'C2C':
					return this.conversation.conversationID.replace('C2C', '');

				case 'GROUP':
					return this.conversation.conversationID.replace('GROUP', '');

				default:
					return this.conversation.conversationID;
			}
		},
		handleCalling(value) {
			// todo 目前支持单聊
			if (this.conversation.type === 'GROUP') {
				uni.showToast({
					title: '群聊暂不支持',
					icon: 'none'
				});
				return;
			}
			const { userID } = this.conversation.userProfile;

			// #ifdef APP-PLUS
			if(typeof(uni.$TUICalling) === 'undefined') {
					logger.error('请使用真机运行并且自定义基座调试，可能影响音视频功能～ 插件地址：https://ext.dcloud.net.cn/plugin?id=7097 , 调试地址：https://nativesupport.dcloud.net.cn/NativePlugin/use/use');
					uni.showToast({
						title: '请使用真机运行并且自定义基座调试，可能影响音视频功能～ ',
						icon: 'none',
						duration: 3000
					});
			} else {
				uni.$TUICalling.call(
					{
						userID: userID,
						type: value
					},
					res => {
						console.log(JSON.stringify(res));
					}
				);
			}
			// #endif
			// #ifdef MP-WEIXIN
			uni.showToast({
				title: '微信小程序暂不支持',
				icon: 'none'
			});
			// uni.$wxTUICalling.call({userID, type: value})
			// #endif
		},
		
		/// 验证文本是否通过
		async VerifyText(text) {
			let date = new Date();
			return new Promise((resolve, reject) => {
				uni.request({
					url: 'https://rcgalleryapi.elong.com/fraud/marketing',
					method: "POST",
					header: {
						'content-type': 'application/json'
					},
					data: JSON.stringify({
						action: 'TextV2Instances',
						actionTime: this.$api.format(date.getTime()),
						product: 'hotel',
						businessType: 'txt',
						productLabeling: 'aidianjing-txt',
						channel: '852',
						ServiceParameters: JSON.stringify({
							content: text
						})
					}),
					success(res) {
						if (res.data.data.riskLevel != 'PASS') {
							resolve(false);
						}else{
							resolve(true);
						}
					}
				})
			})
		
		},
		async sendTextMessage(msg, flag) {
			const to = this.getToAccount();
			
			const text = flag ? msg : this.inputText;
			
			// let status = await this.VerifyText(text);
			const message = tim.createTextMessage({
				to,
				conversationType: this.conversation.type,
				payload: {
					text
				},
				needReadReceipt: true
			});
			this.inputText=''
			this.sendMessageBtn=false
			// this.setData({
			// 	inputText: '',
			// 	sendMessageBtn: false
			// });
			// console.log(message)
			// return
			this.$sendTIMMessage(message);
		},

		onInputValueChange(event) {
			if (event.detail.value) {
				this.sendMessageBtn=true
			} else {
				this.sendMessageBtn=false
			}
		},

		$handleSendTextMessage(event) {
			this.sendTextMessage(event.detail.message, true);
			this.displayCommonWords=false
		},

		$handleSendCustomMessage(e) {
			const message = uni.$TUIKit.createCustomMessage({
				to: this.getToAccount(),
				conversationType: this.conversation.type,
				payload: e.detail.payload
			});
			this.$sendTIMMessage(message);
			this.displayOrderList=false
		},
		$handleCloseCards(e){
			switch (e.detail.key) {
				case '0':
					this.displayCommonWords=false
					break;

				case '1':
					this.displayOrderList=false
					break;

				case '2':
					this.displayServiceEvaluation=false
					break;

				default:
					break;
			}
		},
		groupPush(e,message){
			// console.log(global.apiUrls.groupPush)
			// let e='yyy17108194443'
			if(e){
				this.$api.post(global.apiUrls.groupPush,{
					user_ids:e,
					// url:'/pages/TUIKit/TUI-Chat/chat?conversationID='+message.conversationID
				}).then(res => {
				   console.log(res)
				}).catch(err => {
				  console.log(err)
				})
			}else{
				this.$message.info('该群聊已解散')
			}
			
		},
		$sendTIMMessage(message) {
			console.log(message)
			// this.groupPush()
			// return
			if(message.type=='TIMSoundElem'||message.type=='TIMCustomElem'||message.type=='TIMImageElem'||message.type=='TIMVideoFileElem'){
				// console.log(0)
				const SDKAppID = 1600102039;
				this.$emit('sendMessage', {
					detail: {
						message
					}
				});
				tim.sendMessage(message).then((res) => {
					if(this.firstSendMessage) {
						uni.$aegis.reportEvent({
						    name: 'sendMessage',
						    ext1: 'sendMessage-success',
						    ext2: 'uniTuikitExternal',
						    ext3: `${SDKAppID}`,
						})
					}
					this.firstSendMessage = false
				}).catch((error) => {
					console.log(666)
					uni.$aegis.reportEvent({
							name: 'sendMessage',
							ext1: `sendMessage-failed#error: ${error}`,
							ext2: 'uniTuikitExternal',
							ext3: `${SDKAppID}`,
				  })
				})
				this.displayFlag=''
				if(this.conversation.type === 'GROUP'){
					let imageList=this.conversation.imageList
					console.log(imageList)
					if(imageList.length>0){
						let a=[]
						imageList.forEach(result=>{
							a.push(result.userID)
						})
						let data=a.join(',')
						// this.groupPush(data,message)
					}
					
					
				}else{
					console.log(132)
					let data=this.conversation.userProfile.userID
					// this.groupPush(data)
				}
			}else{
				const SDKAppID = 1600102039;
				console.log(11,SDKAppID)
				this.$emit('sendMessage', {
					detail: {
						message
					}
				});
				tim.sendMessage(message).then((res) => {
					if(this.firstSendMessage) {
						uni.$aegis.reportEvent({
							name: 'sendMessage',
							ext1: 'sendMessage-success',
							ext2: 'uniTuikitExternal',
							ext3: `${SDKAppID}`,
						})
					}
					this.firstSendMessage = false
				}).catch((error) => {
					console.log(111,error)
					
					// uni.$aegis.reportEvent({
					// 		name: 'sendMessage',
					// 		ext1: `sendMessage-failed#error: ${error}`,
					// 		ext2: 'uniTuikitExternal',
					// 		ext3: `${SDKAppID}`,
				 //  })
				})
				this.displayFlag=''
				console.log(333,this.conversation)
				if(this.conversation.type === 'GROUP'){
					let imageList=this.conversation.imageList
					console.log(imageList)
					// let a=[]
					// imageList.forEach(result=>{
					// 	a.push(result.userID)
					// })
					// let data=a.join(',')
					// this.groupPush(data,message)
					
				}else{
					let data=this.conversation.userProfile.userID
					console.log(data)
					// this.groupPush(data)
				}
				// // console.log(1)
				// this.$api.get(global.apiUrls.sensitive_word,{
				// 	msg:message.payload.text,
				// }).then(res => {
				//   let data=res.data.data
				//  if(res.data.code==1){
					
				//  }else{
				// 	 uni.showToast({
				// 	 	title:'内容含有敏感词',
				// 		icon:"error"
				// 	 })
				//  }
				 
				// }).catch(err => {
				  
				// })
			}
		},

		handleClose() {
			this.displayFlag=''
		},

		handleServiceEvaluation() {
			this.displayServiceEvaluation=true
		},

		inputBindFocus() {
			console.log('占位：函数 inputBindFocus 未声明');
		},

		inputBindBlur() {
			console.log('占位：函数 inputBindBlur 未声明');
		}
	}
};
</script>
<style>
@import './index.css';
</style>
